events {}

http {
	resolver 127.0.0.1;
	upstream flask_servers {
		server localhost:5001;
		server localhost:5002;
	}
	server{
		listen 5000;
		server_name flask;
		return 301 https://$host$request_uri;	
}
	server {
		listen 443 ssl;
		ssl_certificate /etc/ssl/certs/nginx-selfsigned.crt;
		ssl_certificate_key /etc/ssl/private/nginx-selfsigned.key;		
		server_name flask;

		location / {
			try_files $uri $uri/=404;
			proxy_pass http://flask_servers;
		}
	}
}
